import { ZCC_TYPE } from "../../../typings/types/common";
import { Operation } from "../../../typings/types/operation";
import { http } from "../../../utils/request";

export const getAbnormalOperationListAPI = (companyId: string, page: number) => {
  let data = {
    companyId: companyId,
    page: page,
    perPage: 10
  }
  return http<ZCC_TYPE.ListResult<Operation.Abnormal>>({
    url: '/operationalRisk/abnormalOperationPage',
    method: 'GET',
    data: data
  });
};
//欠税公告
export const getTaxNoticeListAPI = (companyId: string, page: number, category: string) => {
  let data = {
    companyId: companyId,
    page: page,
    perPage: 10
  }
  if (category && category.length > 0) {
    let cate = { 'category': category }
    data = { ...data, ...cate }
  }
  return http<ZCC_TYPE.ListResult<Operation.TaxNoticeList>>({
    url: '/operationalRisk/getOweTaxNoticePage',
    method: 'GET',
    data: data
  });
};

export const getTaxNoticeDropDownListAPI = (companyId: string) => {

  return http<Operation.TaxNoticeDropDownList>({
    url: '/operationalRisk/OweTaxNotice/dropDown',
    method: 'GET',
    data: { companyId: companyId }
  });
};
//股权出质
export const getStockPledgeListAPI = (companyId: string, page: number, status: string) => {
  let data = {
    companyId: companyId,
    page: page,
    perPage: 10
  }
  if (status && status.length > 0) {
    let cate = { 'stkPawnStatus': status }
    data = { ...data, ...cate }
  }
  return http<ZCC_TYPE.ListResult<Operation.StockPledgeList>>({
    url: '/operationalRisk/equityPledgePage',
    method: 'GET',
    data: data
  });
};

export const getStockPledgeDropDownListAPI = (companyId: string) => {

  return http<Operation.StockPledgeDropDownList>({
    url: '/operationalRisk/equityPledge/dropDown',
    method: 'GET',
    data: { companyId: companyId }
  });
};
//动产抵押
export const getChattelMortgageListAPI = (companyId: string, page: number, query: string) => {
  let data = {
    companyId: companyId,
    page: page,
    perPage: 10
  }
  if (query && query.length > 0) {
    let cate = { 'query': query }
    data = { ...data, ...cate }
  }
  return http<ZCC_TYPE.ListResult<Operation.ChattelMortgageList>>({
    url: '/operationalRisk/getOperationMpledgePage',
    method: 'GET',
    data: data
  });
};
//土地拍卖
export const getLandAuctionListAPI = (companyId: string, page: number, query: string) => {
  let data = {
    companyId: companyId,
    page: page,
    perPage: 10
  }
  if (query && query.length > 0) {
    let cate = { 'query': query }
    data = { ...data, ...cate }
  }
  return http<ZCC_TYPE.ListResult<Operation.LandAuctionList>>({
    url: '/operationalRisk/getLandaucPartyPage',
    method: 'GET',
    data: data
  });
};
//严重违法
export const getSeriousIllegalityListAPI = (companyId: string, page: number) => {
  let data = {
    companyId: companyId,
    page: page,
    perPage: 10
  }
  return http<ZCC_TYPE.ListResult<Operation.SeriousIllegalityList>>({
    url: '/operationalRisk/seriousViolationsPage',
    method: 'GET',
    data: data
  });
};
//清算
export const getLiquidationListAPI = (companyId: string, page: number) => {
  let data = {
    companyId: companyId,
    page: page,
    perPage: 10
  }
  return http<ZCC_TYPE.ListResult<Operation.LiquidationList>>({
    url: '/operationalRisk/getOperationLiquidationPage',
    method: 'GET',
    data: data
  });
};
//土地抵押
export const getLandMortgageListAPI = (companyId: string, page: number) => {
  let data = {
    companyId: companyId,
    page: page,
    perPage: 10
  }
  return http<ZCC_TYPE.ListResult<Operation.LandMortgageList>>({
    url: '/operationalRisk/LandMortgagePage',
    method: 'GET',
    data: data
  });
};
//重大税收违法
export const getSeriousTaxIllegalityListAPI = (companyId: string, page: number, caseType: string) => {
  let data = {
    companyId: companyId,
    page: page,
    perPage: 10
  }
  if (caseType && caseType.length > 0) {
    let cate = { 'caseType': caseType }
    data = { ...data, ...cate }
  }
  return http<ZCC_TYPE.ListResult<Operation.SeriousTaxIllegalityList>>({
    url: '/operationalRisk/getMajorViolationPage',
    method: 'GET',
    data: data
  });
};


export const getSeriousTaxIllegalityDropDownListAPI = (companyId: string) => {

  return http<Operation.SeriousTaxIllegalityDropDownList>({
    url: '/operationalRisk/MajorViolation/dropDown',
    method: 'GET',
    data: { companyId: companyId }
  });
};


export const getLandAuctionDetailAPI = (id: number) => {
  return http<Operation.LandAuctionDetail>({
    url: '/operationalRisk/getLandaucPartyDetail',
    method: 'GET',
    data: {
      id: id
    }
  });
};

export const getLandMortgageDetailAPI = (id: number) => {
  return http<Operation.LandMortgageList>({
    url: '/operationalRisk/getLandMortgageDetail',
    method: 'GET',
    data: {
      id: id
    }
  });
};

export const getChattelMortgageDetailAPI = (id: number) => {
  return http<Operation.ChattelMortgageDetail>({
    url: '/operationalRisk/getOperationMpledgeDetail',
    method: 'GET',
    data: {
      id: id
    }
  });
};